export const bankOption = function () {
  return {
    refreshBtn: true,
    columnBtn: true,
    border: true,
    stripe: true,
    index: true,
    editBtn: true,
    delBtn: true,
    align: 'center',
    addBtn: !['view'].includes(this.type),
    menu: !['view'].includes(this.type),
    indexLabel: '序号',
    column: [
      {
        label: '账户名称',
        prop: 'bankAccountName',
        maxlength: 20,
        span: 12,
        rules: [
          {
            required: true,
            message: '请输入账户名称',
            trigger: 'blur'
          }
        ],
        slot: this.slotFlg,
        minWidth: 100
      },
      {
        label: '银行账号',
        prop: 'bankAccount',
        maxlength: 20,
        span: 12,
        rules: [
          {
            required: true,
            message: '请输入银行账号',
            trigger: 'blur'
          }
        ],
        slot: this.slotFlg,
        minWidth: 100
      },
      {
        label: '开户行名称',
        prop: 'bankName',
        labelWidth: 100,
        span: 12,
        maxlength: 50,
        formslot: true,
        // change:({getColumnByProp, form})=>{
        //   const { dicData } = getColumnByProp('bankCode')
        //   console.log(dicData)

        // },
        // type: 'select',
        // remote: true,
        // props: {
        //   label: 'bankName',
        //   value: 'bankName'
        // },
        // dicUrl: `/biz-api/pv-supplier/bank/getBankInfo?bankName={{key}}`,
        rules: [
          {
            required: true,
            message: '请输入开户行名称',
            trigger: 'blur'
          }
        ],
        slot: this.slotFlg,
        minWidth: 150
      },
      {
        label: '开户行行号',
        prop: 'bankCode',
        labelWidth: 100,
        span: 12,
        maxlength: 50,
        formslot: true,
        // type: 'select',
        // remote: true,
        // props: {
        //   label: 'bankCode',
        //   value: 'bankCode'
        // },
        // change:({getColumnByProp, form})=>{
        //   const { dicData1 } = getColumnByProp('bankName')
        //   console.log(dicData1)

        // },
        // dicUrl: `/biz-api/pv-supplier/bank/getBankInfo?bankCode={{key}}`,
        rules: [
          {
            required: true,
            message: '请输入开户行行号',
            trigger: 'blur'
          }
        ],
        slot: this.slotFlg,
        minWidth: 100
      }
    ]
  }
}

export const financeOption = function () {
  return {
    refreshBtn: true,
    columnBtn: true,
    border: true,
    stripe: true,
    index: true,
    editBtn: true,
    delBtn: true,
    align: 'center',
    addBtn: !['view'].includes(this.type),
    menu: !['view'].includes(this.type),
    indexLabel: '序号',
    labelWidth: 140,
    column: [
      {
        label: '年份',
        prop: 'year',
        maxlength: 20,
        span: 12,
        slot: this.slotFlg,
        rules: [
          {
            required: true,
            message: '请输入年份',
            trigger: 'blur'
          }
        ]
      },
      {
        label: '企业总资产(万元)',
        prop: 'totalAssets',
        precision: 4,
        type: 'number',
        span: 12,
        slot: this.slotFlg,
        rules: [
          {
            required: true,
            message: '请输入企业总资产',
            trigger: 'blur'
          }
        ]
      },
      {
        label: '企业总负债(万元)',
        prop: 'totalLiabilities',
        precision: 4,
        type: 'number',
        slot: this.slotFlg,
        span: 12
      },
      {
        label: '流动资产(万元)',
        prop: 'currentAssets',
        precision: 4,
        type: 'number',
        slot: this.slotFlg,
        span: 12
      },
      {
        label: '流动负债(万元)',
        prop: 'currentLiabilities',
        precision: 4,
        type: 'number',
        slot: this.slotFlg,
        span: 12
      },
      {
        label: '营业收入(万元)',
        prop: 'businessIncome',
        precision: 4,
        type: 'number',
        span: 12,
        slot: this.slotFlg,
        rules: [
          {
            required: true,
            message: '请输入营业收入',
            trigger: 'blur'
          }
        ]
      },
      {
        label: '毛利润(万元)',
        prop: 'grossProfit',
        precision: 4,
        type: 'number',
        slot: this.slotFlg,
        span: 12
      },
      {
        label: '净利润(万元)',
        prop: 'netProfit',
        precision: 4,
        type: 'number',
        slot: this.slotFlg,
        span: 12
      }
    ]
  }
}
